#include<iostream>
#include<sstream>
#include<string>
#include<streambuf>
#include<fstream>
#include<queue>

using namespace std;


class IStreamQueue
    : public std::istream, 
      protected std::queue<istream>
{
    typedef queue<std::istream> QUEUE;
    typedef std::istream IS;
    IS CUR_IS;
public:
    using QUEUE::push;
    IStreamQueue& get(char& c) {
        
    }
};


int main(int args, char** argv)
{

    IStreamQueue iq();

    stringstream ss;

    for(int i = 1; i < args; i++) {
        ifstream ifs(argv[i]);

        while(ifs>>ss.rdbuf());

        ifs.close();
    }

    while(cin >> ss.rdbuf());

    cout<< ss.rdbuf();

    cout << endl;
    return 0;
}

